package org.ssi.dao;

import java.util.HashMap;
import java.util.List;

import org.springframework.dao.DataAccessException;

import com.bjtech.web.util.SelectBean;

/**
 * ssi dao interface
 * 
 * @author 
 */
public interface BaseDao<T> {
	/**
	 * value is "insert"
	 */
	public static final String PREFIX_INSERT = "insert";

	/**
	 * value is "update"
	 */
	public static final String PREFIX_UPDATE = "update";

	/**
	 * value is "delete"
	 */
	public static final String PREFIX_DELETE = "delete";

	/**
	 * value is "select"
	 */
	public static final String PREFIX_SELECT = "select";

	/** value is "Count" */
	public static final String POSTFIX_COUNT = "Count";

	/**
	 * value is "List"
	 */
	public static final String POSTFIX_LIST = "List";

	/**
	 * value is "PaginatedList"
	 */
	public static final String POSTFIX_PAGINATED_LIST = "PaginatedList";

	int deleteEntity(T entity,Long id) throws DataAccessException;

	Long insertEntity(T entity) throws DataAccessException;

	T selectEntity(T entity,Long id) throws DataAccessException;

	Long selectEntityCount(T entity,SelectBean sb) throws DataAccessException;

	List<HashMap> selectEntityList(T entity,SelectBean sb) throws DataAccessException;

	List<HashMap> selectEntityPaginatedList(T entity,SelectBean sb) throws DataAccessException;

	int updateEntity(T entity) throws DataAccessException;

}